from typing import *


class ListNode:

    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next


class Solution:

    def doubleIt(self, head: Optional[ListNode]) -> Optional[ListNode]:

        def reverse(head):
            p = None
            while head:
                nxt = head.next
                head.next = p
                p = head
                head = nxt
            return p

        def double(head):
            carry = 0
            t, p = None, head
            while p:
                t = p
                val = p.val * 2 + carry
                p.val = val % 10
                carry = val // 10
                p = p.next
            if carry > 0:
                tail = ListNode(val=carry)
                t.next = tail
            return head

        head = reverse(head)
        head = double(head)

        return reverse(head)


c = 1552914.0
b = 950000
y = 5
a = 1.00
while b * pow(a, y) < c:
    a += 0.001
print(a)


c = 83.49
b = 51.3
y = 5
a = 1.00
while b * pow(a, y) < c:
    a += 0.001
print(a)